<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>sticky元素不属于同一父元素，但父元素正好紧密相连</title>
</head>

<body>
    会挤开原来的元素，形成依次占位的效果<br />
    所谓粘性，仅在其父元素中表现出来
    <article>
        <section>
            <h4>黄河之水天上来-1</h4>
            <div>优美的古诗词</div>
        </section>
        <section>
            <h4>黄河之水天上来-2</h4>
            <div>优美的古诗词</div>
        </section>
        <section>
            <h4>黄河之水天上来-3</h4>
            <div>优美的古诗词</div>
        </section>
        <section>
            <h4>黄河之水天上来-4</h4>
            <div>优美的古诗词</div>
        </section>
        <section>
            <h4>黄河之水天上来-5</h4>
            <div>优美的古诗词</div>
        </section>


    </article>
    <style>
        article {
            overflow: auto;
            height: 200px;
        }

        article h4 {
            position: sticky;
            background-color: lightseagreen;
            color: #fff;
            padding: 10px;
            top: 0;
        }

        article div {
            background-color: lightskyblue;
        }
    </style>
</body>

</html>